package main //必须有个main包

import "fmt"

func modify(a [5]int) {
	a[0] = 666
	fmt.Println("modify a = ", a)
}

func modify_pointer(p *[5]int) {
	(*p)[0] = 666
	fmt.Println("modify *a = ", *p)
}

func main() {
	a := [5]int{1, 2, 3, 4, 5} //初始化

	modify(a) //数组复制传递
	fmt.Println("main: a = ", a)
	modify_pointer(&a) //数组引用传递
	fmt.Println("pointer-main: a = ", a)
}
